home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 6
/
CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso
/
cucd
/
readers
/
utils
/
gui4cli
/
demos
/
lock.gc
< prev
next >
Wrap
Text File
|
1996-10-28
|
3KB
|
112 lines
G4C
; This is a LOCK for your amiga.
; All it does is to put up a full screen borderless window, which will
; not close untill you give the correct pass code (which is 123)
; You can of course bypass it by booting from a diskette, but otherwise,
; it is pretty reliable as a lock.
WINBIG 0 0 0 0 "" ; a window at 0,0, screen wide & high
WinType 000010 ; borderless window, with no gadgets
WinBackground PATTERN 1 3 ; a sexy backfill pattern to impress everyone :)
xONLOAD
setvar lockvar "" ; We clear the code variable
GuiOpen lock.gc ; and open the gui upon loading.
xONQUIT
delvar lockvar ; On quitting we delete the variable.
; We declare the following xONKEY events, so that we disable the standard
; window shortcuts (with which the lock could be bypassed).
xONKEY #3 ; Control C - Close window
xONKEY #2 ; Control B - Window to back
xONKEY #5 ; Control E - Edit window
xONKEY #18 ; Control R - Reload
xONKEY #14 ; Control N - Next Window
xONKEY #17 ; Control Q - Quit Window
xONKEY #26 ; Control Z - Zoom Window
xONKEY #19 ; Control S - Status
TEXT 0 75 0 15 "Input the correct pass code or swicth off NOW !!" 70 BOX
GadTXT CENTER
; We tell the user the pass code. Delete this line if you want a real lock.
TEXT 0 190 0 15 "Input 123 and click on enter." 70 BOX
GadID 2
GadTXT CENTER
xBUTTON 200 100 25 15 1 ; The number buttons (with keyboard shortcuts)
GadKey 1
AppVar lockvar 1 ; When pressed, we append '1' to our variable
update lock.gc 1 $lockvar ; and redraw the TEXT gadget.
xBUTTON 225 100 25 15 2 ; Same as above, but for '2'
GadKey 2
AppVar lockvar 2
update lock.gc 1 $lockvar
xBUTTON 250 100 25 15 3
GadKey 3
AppVar lockvar 3
update lock.gc 1 $lockvar
xBUTTON 275 100 25 15 4
GadKey 4
AppVar lockvar 4
update lock.gc 1 $lockvar
xBUTTON 300 100 25 15 5
GadKey 5
AppVar lockvar 5
update lock.gc 1 $lockvar
xBUTTON 325 100 25 15 6
GadKey 6
AppVar lockvar 6
update lock.gc 1 $lockvar
xBUTTON 350 100 25 15 7
GadKey 7
AppVar lockvar 7
update lock.gc 1 $lockvar
xBUTTON 375 100 25 15 8
GadKey 8
AppVar lockvar 8
update lock.gc 1 $lockvar
xBUTTON 400 100 25 15 9
GadKey 9
AppVar lockvar 9
update lock.gc 1 $lockvar
xBUTTON 425 100 25 15 0
GadKey 0
AppVar lockvar 0
update lock.gc 1 $lockvar
TEXT 200 125 250 15 "" 100 BOX ; This is the TEXT display.
GADID 1 ; Give it an ID so we can change it.
xBUTTON 275 150 100 25 "Enter!" ; Here we check the code against "123"
GadKey #13 ; (keyboard shortcut for enter key)
if $lockvar = 123 ; and quit if correct.
GUIQUIT lock.gc
else
update lock.gc 1 "Wrong Code ! Switch OFF !!"
Setvar lockvar "" ; Clear the variable for an other try.
Update lock.gc 2 "Hey!! I said put 123 and click Enter !!"
; and tell the user again how to pass.
endif
; If we wanted a real lock, we would delete the TEXT saying the pass code,
; change the code to an other number and change the above 'else' commands.